package com.project.smms.service.impl;

import com.project.smms.dao.GoodsMapper;
import com.project.smms.pojo.Goods;
import com.project.smms.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 莫息涛
 * @Description: 商品的服务层实现类
 * @date 2020/3/6 16:21
 */
@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public List<Goods> selectGoods() {
        return goodsMapper.selectGoods();
    }

    @Override
    public Goods selectGoodsById(int goods_id) {
        return goodsMapper.selectGoodsById(goods_id);
    }

    @Override
    public int addGoods(Goods goods) {
        return goodsMapper.addGoods(goods);
    }

    @Override
    public int updateGoods(Goods goods) {
        return goodsMapper.updateGoods(goods);
    }

    @Override
    public int deleteGoods(int goods_id) {
        return goodsMapper.deleteGoods(goods_id);
    }
}
